//
//  FKMemberChild.m
//  WanTao
//
//  Created by Macbook Pro on 2019/3/30.
//  Copyright © 2019 Macbook Pro. All rights reserved.
//

#import "FKMemberChild.h"

@implementation FKMemberChild

- (void)mj_keyValuesDidFinishConvertingToObject
{
    if ([_sp_level isEqualToString:@"20"]) {
        _levelName = @"VIP";
        _levelTitleColor = [UIColor fk_colorWithHex:0xFF982F];
        _levelBgColor = [UIColor fk_colorWithHex:0xFF982F alpha:0.2];
    } else if ([_sp_level isEqualToString:@"30"]) {
        _levelName = @"总监";
        _levelTitleColor = [UIColor fk_colorWithHex:0x589EF7];
        _levelBgColor = [UIColor fk_colorWithHex:0x589EF7 alpha:0.2];
    } else if ([_sp_level isEqualToString:@"40"]) {
        _levelName = @"总经理";
        _levelTitleColor = [UIColor fk_colorWithHex:0xFF2E2E];
        _levelBgColor = [UIColor fk_colorWithHex:0xFF2E2E alpha:0.2];
    }
}

- (void)setType:(NSInteger)type
{
    _type = type;
    
    if (type == 20) {
        _timeStr = fkFORMAT(@"加入时间: %@", [_promotion_time fk_timeWithFormat:@"yyyy-MM-dd"]);
    } else if (type == 10) {
        _timeStr = fkFORMAT(@"到期时间: %@", [_end_time fk_timeWithFormat:@"yyyy-MM-dd"]);
    } else {
        _timeStr = [_invite_time fk_timeWithFormat:@"yyyy-MM-dd"];
    }
}

@end
